<template>
  <div class="home-banner">
    <el-carousel height="500px">
      <el-carousel-item v-for=" item in bannerlist " :key="item.id">
        <img :src="item.imgUrl"  alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script setup>
import { getBannerAPI } from '@/apis/Home';
import { onMounted, ref } from 'vue';

const bannerlist = ref([]);
const getBanner = async()=>{
  const res = await getBannerAPI()
  bannerlist.value = res.data.result;

}
onMounted(()=>getBanner());

</script>

<style lang="scss" scoped>
.home-banner{
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  img{
    width: 100%;
    height: 500%;
  }
}
</style>
